package com.vcc.service.boss.response.userCard;

import com.vcc.data.entity.UserCard;
import com.vcc.service.boss.response.cardholder.CardholderVo;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

@Data
@Setter
@Getter
@ToString
public class UserCardInfoVo implements Serializable {

    private String cardNumber;

    private String vcc;

    private String expiry;

    private CardholderVo cardholderVo;

    public UserCardInfoVo() {
    }

    public UserCardInfoVo(UserCard userCard, CardholderVo cardholderVo, Boolean hasShowSecretInfo) {
        this.cardNumber = userCard.getCardNumber();
        this.vcc = hasShowSecretInfo ? userCard.getVcc() : "***";
        this.expiry = hasShowSecretInfo ? userCard.getExpiry() : "****-**";
        this.cardholderVo = cardholderVo;
    }
}
